AEGetNthPtr
typeCode, dataPtr, maximumSize, actualSize );
long index ; position of descriptor record in list
AEKeyword * theAEKeyword ; keyword of specified descriptor record DescType * typeCode ; pointer to descriptor type Ptr dataPtr ; pointer to data buffer Size maximumSize ; maximum size of data buffer Size * actualSize ; actual size of data field You can use the AEGetNthPtr function to get a pointer to a buffer that contains a descriptor record from any descriptor list.
The AEGetNthPtr function uses a buffer to return a specified descriptor record from a specified descriptor list; the function attempts to coerce the
descriptor record to the descriptor type specified by the desiredType
parameter.
from an array contained in a descriptor list.
descriptor record.
The index parameter specifies the position of the desired descriptor record in the list (for example, 2 specifies the second descriptor record).
The desiredType parameter is the descriptor type of the resulting data; if the coerce it into this type. If the value of desiredType is typeWildCard, no coercion is performed, and the descriptor type of the resulting data is the same
as the descriptor type of the original descriptor record.
If you are getting data from a list of keyword-specified descriptor records,
the keyword of the specified descriptor record is returned in the parameter
theAEKeyword; otherwise, the value typeWildCard is returned. The returned data's descriptor type is returned in the typeCode parameter.
The dataPtr parameter is the pointer to the buffer for storing the data. The maximumSize parameter is the maximum length, in bytes, of the data to be returned.
The AEGetNthPtr function returns in the actualSize parameter the actual length, in bytes, of the data for the descriptor record. If this value is larger
than the value of maximumSize, not all of the data for the descriptor record
was returned.
For an example program showing use of AEGetNthPtr, see the description of Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAECoercionFail (-1700) Data could not be coerced to descriptor type
errAEDescNotFound (-1701) Descriptor record was not found
errAEWrongDataType (-1703) Wrong descriptor type
errAENotAEDesc (-1704) Not a valid descriptor record
errAEReplyNotArrived (-1718) Reply has not yet arrived